feat(analytics): add configureAutoTrack support for Kinesis and Kinesis Firehose#14854
Merged
Conversation
🦋 Changeset detectedLatest commit: b3b9268 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
osama-rizk
reviewed
Jul 8, 2026
osama-rizk
approved these changes
Jul 9, 2026
bobbor
approved these changes
Jul 14, 2026
bobbor
left a comment
Member
There was a problem hiding this comment.
Reviewed — looks good to me. The concurrent multi-provider PageViewTracker concern from the first round (shared sessionStorage key + stacked history proxies) is correctly resolved via per-provider key namespacing and the ref-counted global history patch, with solid regression coverage. Approving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Adds
configureAutoTrack(auto-tracking) support to the Kinesis and Kinesis Firehose Analytics providers. Auto-tracking (session / pageView / event trackers) previously existed only for Pinpoint; this brings the same capability to the two stream providers.This change is purely additive — Pinpoint behavior is unchanged.
What it adds
configureAutoTrack(input)for both providers, mirroring the existing Pinpoint implementation (module-levelconfiguredTrackerssingleton,updateProviderTrackers+validateTrackerConfiguration, session/pageView/event tracker types).record()API with the data shape{ name: eventName, attributes }(mirrorsPinpointAnalyticsEvent).streamName(andpartitionKeyfor Kinesis) are supplied in eachconfigureAutoTrackcall'soptions, so different tracker types can target different streams. Reconfiguring a tracker updates its stream coordinates.KinesisConfigureAutoTrackInput/KinesisFirehoseConfigureAutoTrackInputand theirSession/PageView/Eventtracking-option types, exported from each provider's public entry point.Kinesis Firehose difference: Firehose has no
partitionKey, so its options only carrystreamNameand itsrecord()call omitspartitionKey.Shared-infra decouple
utils/trackerHelpers.tsnow typesupdateProviderTrackersagainst the genericAnalyticsConfigureAutoTrackInput(from../types/inputs) instead of the Pinpoint-specificConfigureAutoTrackInput. Pinpoint's type is a structural alias of the generic one, so Pinpoint continues to compile and behave identically.Runtime validation (options stay optional in the type; validated at runtime)
AnalyticsValidationErrorCode.NoStreamNamewhenenable: trueandstreamNameis missing.AnalyticsValidationErrorCode.NoPartitionKeywhenenable: trueandpartitionKeyis missing.enable: false.React Native is unchanged — both providers inherit the existing shared validator that restricts auto-tracking to
sessionon native.Issue #, if available
N/A
Description of how you validated changes
__tests__/providers/kinesis/apis/configureAutoTrack.test.ts__tests__/providers/kinesis-firehose/apis/configureAutoTrack.test.ts__tests__/utils/trackerHelpers.test.ts(provesupdateProviderTrackersaccepts a generic, non-Pinpoint input and forwards options; provider-specific fields are ignored by the shared trackers)validateTrackerConfigurationinvoked;NoStreamName/NoPartitionKeythrown when enabling without the required fields; no throw when disabling; session/pageView/event trackers fire and callrecord()with the correct{ streamName[, partitionKey], data: { name, attributes } }; reconfigure updates stream coordinates; disable cleans trackers up.aws-amplifyexports test: passes — 14 tests.exports.test.tsupdated so the Kinesis and Kinesis Firehose expected-export arrays includeconfigureAutoTrack.tsc --noEmit -p tsconfig.build.jsonis clean (exit 0), no new errors and no Pinpoint regressions.Checklist
yarn testpassesChecklist for repo maintainers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.